

def get_ids(prefix, date_list):
    index = 1
    temp_date_list = []
    for i in range(len(date_list)):
        temp_date_list.append({
            "index": i,
            "date": date_list[i],
        })
    temp_date_list.sort(key=lambda k: k["date"])
    for i in range(len(temp_date_list)):
        if i > 0:
            if temp_date_list[i]["date"] != temp_date_list[i-1]["date"]:
                index = 1
            else:
                index += 1
        new_id = f'{prefix}_{temp_date_list[i]["date"]}_{index:03d}'
        temp_date_list[i]["new_id"] = new_id
    temp_date_list.sort(key=lambda k: k["index"])
    return list(map(lambda x: x["new_id"], temp_date_list))


def is_empty(value):
    return value is None or str(value).strip() == ''


# 交换一个字典的key和value
def exchange_dict_key_and_value(dict_data):
    new_dict = {}
    for key, value in dict_data.items():
        new_dict[value] = key
    return new_dict